<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>投诉反馈</title>
		<link rel="stylesheet" type="text/css" href="css/css-comment.css" />
		<link rel="stylesheet" type="text/css" href="css/appeal.css" />
	</head>
	<body>
		<div class="appealabox">
			<div class="appeala">
				<div class="appealai">
					<div class="appealail">选择订单</div>
					<div class="appealair">
						<select id="orderselect" name="">
							<option value="0">请选择</option>
							<option value="1">订单一</option>
							<option value="2">订单二</option>
						</select>
					</div>
				</div>
				<div class="appealai">
					<div class="appealail">联系电话</div>
					<div class="appealair">
						<input id="phone" type="tel" placeholder="请输入您的手机号码" />
					</div>
				</div>
			</div>
			<div class="appealb">申诉原因</div>
			<div class="appealc">
				<div class="appealci">
					<div class="appealcil appealcil_cheak"></div>
					<div class="appealcir">支付设备不启动</div>
				</div>
				<div class="appealci">
					<div class="appealcil"></div>
					<div class="appealcir">充值未到账</div>
				</div>
				<div class="appealci">
					<div class="appealcil"></div>
					<div class="appealcir">退款未成功</div>
				</div>
				<div class="appealci">
					<div class="appealcil"></div>
					<div class="appealcir">其他</div>
				</div>
			</div>
			<div class="appeald">
				<textarea id="appealddetail" placeholder="请输入故障详情"></textarea>
			</div>
			<div class="appeale">提交</div>
		</div>
		<div class="tip"></div>
	</body>
	<script type="text/javascript" src="js/rem.js"></script>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script type="text/javascript">
		//选择申诉原因
		$('.appealci').click(function() {
			$('.appealcil').removeClass('appealcil_cheak');
			$(this).find('.appealcil').addClass('appealcil_cheak');
		})

		$('.appeale').click(function() {
			var myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;
			if($("#orderselect option:selected").val() == 0) {
				$(".tip").fadeIn();
				$(".tip").text('请选择订单');
				setTimeout(function() {
					$(".tip").fadeOut();
				}, 1000)
				return false;
			} else if($('#phone').val().trim() == '') {
				$(".tip").fadeIn();
				$(".tip").text('请输入电话号码');
				setTimeout(function() {
					$(".tip").fadeOut();
				}, 1000)
				return false;
			} else if(!myreg.test($('#phone').val().trim())) {
				$(".tip").fadeIn();
				$(".tip").text('电话号码有误');
				setTimeout(function() {
					$(".tip").fadeOut();
				}, 1000)
				return false;
			} else if($('.appealci:nth-child(4)').find('.appealcil').hasClass('appealcil_cheak') && $('#appealddetail').val().trim() == '') {
				$(".tip").fadeIn();
				$(".tip").text('请输入故障详情');
				setTimeout(function() {
					$(".tip").fadeOut();
				}, 1000)
				return false;
			} else {
				$(".tip").fadeIn();
				$(".tip").text('提交成功');
				setTimeout(function() {
					$(".tip").fadeOut();
					history.back(-1);
				}, 1000)
			}
		})
	</script>

</html>